package com.qixia.sportsupload.util;

import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;

/**
 * @Author Administrator
 * @Date 2023/6/7
 * @Description
 */

@tk.mybatis.mapper.annotation.RegisterMapper
public interface InsertOrUpdateBatchMapper<T> {
    /**
     * 批量插入全部字段，包括主键
     * @param recordList 数据列表
     * @return
     */
    @InsertProvider(type = BatchUpdateMapperProvider.class, method = "dynamicSQL")
    int insertBatchByPrimaryKeySelective(List<? extends T> recordList);

    /**
     * 根据Example条件批量更新实体`record`包含的不是null的属性值
     *
     * @return
     */
    @UpdateProvider(type = BatchUpdateMapperProvider.class, method = "dynamicSQL")
    int updateBatchByPrimaryKeySelective(List<? extends T> recordList);
}
